<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../ucs.css">
    <link rel="stylesheet" href="../font/iconfont.css">
    <link rel="stylesheet" href="../demo.css">
</head>
<body>
    <div id="main"></div>
    <script type="text/javascript" src="../../dist/libs/u-eventhub.js"></script>
    <script type="text/javascript" src="../../dist/libs/engine.js"></script>
    <script type="text/javascript" src="../../dist/ucsmy-ui.js"></script>

    <script type="text/javascript">
        //企业姓名
        var companyNameDM = new UDM({
            placeholder:"请输入企业名称",
            validator:[
                {type:"require",msg:"企业名称不能为空"}
            ]
        });
        //联系人姓名
        var contactsDM = new UDM({
            placeholder:"请输入联系人姓名",
            validator:[
                {type:"require",msg:"联系人姓名不能为空"}
            ]
        });
        //联系人电话
        var contactsPhoneDM = new UDM({
            placeholder:"请输入联系人电话",
            validator:[
                {type:"require",msg:"联系人电话不能为空"}
            ]
        });
        //开户银行
        var banksDM = new UDM({
            value:[
                {option:"绵阳银行",value:"银行code"},
                {option:"中国工商银行",value:"银行code"},
                {option:"交通银行",value:"银行code"}
            ],
            onChange:function(v){
                console.log(v)
            }
        });
        //银行账号
        var bankNumDM = new UDM({
            placeholder:"请输入银行账号",
            validator:[
                {type:"require",msg:"银行账号不能为空"}
            ]
        });
        //同意协议
        var checkboxDM = new UDM({
            checked:true,
            onClick:function(v){
                console.log(v)
            }
        });
        //立即申请
        var btnDM = new UDM({
            value:'',//类型标识  0 企业贷款； 1 票据
            onClick:function(){
                console.log("立即申请");
                console.log(PageDM.btn.getValue());
                UEventHub.emit('showResult',true,"186****0236")
            }
        });
        var userDM = new UDM({
            value:"",
            text:"您已阅读并接受《 绵阳市商业银行平台服务协议（企业版）》约束，并选择委托银行代为发布融资项目信息，请与您的客户经理联系。"
        });

        /*ajax请求数据*/
        var ajaxFn = function(){
        };

        var PageDM = {
            companyName:companyNameDM,
            contacts:contactsDM,
            contactsPhone:contactsPhoneDM,
            banks:banksDM,
            bankNum:bankNumDM,
            checkbox:checkboxDM,
            btn:btnDM,
            user:userDM
        };
        UEventHub.on('pageLoad',function(){
            ajaxFn();
        });
    </script>
</body>
</html>